﻿@model Bottle.CommunityForum.Model.NodesInfo
@{
    ViewBag.Title = "节点修改";
    Layout = "~/Views/Shared/_FormLayout.cshtml";
}
@if (Model == null)
{

}
else
{
<form class="layui-form">
    <div class="layui-form-item">
        <label for="L_email" class="layui-form-label">父节点</label>
        <div class="layui-input-inline">
            <input type="text" id="parent" name="parent" value="@Model.parent" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="L_email" class="layui-form-label">节点名称</label>
        <div class="layui-input-inline">
            <input type="hidden" id="nodesid" name="nodesid" value="@Model.nodesid" />
            <input type="text" id="nodesname" name="nodesname" value="@Model.nodesname" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="L_email" class="layui-form-label">节点编号</label>
        <div class="layui-input-inline">
            <input type="text" id="nodesno" name="nodesno" value="@Model.nodesno" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="L_pass" class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <textarea class="layui-textarea" name="content" lay-verify="content" id="content">@Model.content</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-inline">
            <button class="layui-btn" lay-filter="login" lay-submit>保存</button>
            <button class="layui-btn" lay-filter="close">关闭</button>
        </div>
    </div>
</form>
}

@section scripts{

    <script>
        layui.config({
            base: "~/Content/res/mods/"
        }).use(['layer', 'form'], function () {
            var layer = layui.layer,
                form = layui.form,
                $ = layui.jquery

            form.on('submit(login)', function (data) {
                $.post('@Url.Action("NodesEdit")', data.field, function (data) {
                    if (data.code == 0) {
                        layer.alert(data.msg);
                    }
                    else {
                        layer.alert(data.msg);
                    }
                }, 'json')
                return false;
            })
        });
    </script>
}
